import Vue from 'vue'
import VueI18n from 'vue-i18n'
import store from '@/store'
Vue.use(VueI18n)

// 导入语言包
import zh from './zh'
import ja from './ja'
import en from './en'

const messages = {
  en,
  zh,
  ja,
}

// 创建i18n实例
const i18n = new VueI18n({
  locale: store.state.language || 'zh', // set locale
  messages, // set locale messages
})

export default i18n
